import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import AutoImportUtils from 'unplugin-auto-import/vite';
import Components from "unplugin-vue-components/vite"


const path = require('path');


export default defineConfig({
  plugins: [
    uni(),
    AutoImportUtils({
      imports: [
        'vue',
      ],
      dts: true,
      dirs: [
        './src/commonUtils',
      ],
      defaultExportByFilename: false,
    }),
    Components({
      dirs: [path.resolve(__dirname, './src/components')],
      // ui库解析器
      resolvers: [],
      dts: "./components.d.ts",

    })    
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },

  },
});
